package Controller
{
	import mx.core.FlexGlobals;
	
	import View.shading.ShadingView;

	public class ShadingController
	{
		public function ShadingController()
		{
		}
		
		public static function updateShadingUIWindow():void
		{
			
			if(FlexGlobals.topLevelApplication.project.shading.shadingInputType == "manual")
			{
				 (FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).manualInput.selected = true;
				 (FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromNeighbouringHouses.enabled = true;
				 (FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromTrees.enabled = true;
				 (FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromBalconies.enabled = true;
			}
			else if(FlexGlobals.topLevelApplication.project.shading.shadingInputType == "average")
			{
				(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).averageShading.selected = true;
			}
			
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromNeighbouringHouses.shadingEast = FlexGlobals.topLevelApplication.project.shading.shadingFromHouses.shadingEast;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromNeighbouringHouses.shadingNorth = FlexGlobals.topLevelApplication.project.shading.shadingFromHouses.shadingNorth;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromNeighbouringHouses.shadingWest = FlexGlobals.topLevelApplication.project.shading.shadingFromHouses.shadingWest;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromNeighbouringHouses.shadingSouth = FlexGlobals.topLevelApplication.project.shading.shadingFromHouses.shadingSouth;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromNeighbouringHouses.shadingSouthEast = FlexGlobals.topLevelApplication.project.shading.shadingFromHouses.shadingSouthEast;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromNeighbouringHouses.shadingNorthEast = FlexGlobals.topLevelApplication.project.shading.shadingFromHouses.shadingNorthEast;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromNeighbouringHouses.shadingSouthWest = FlexGlobals.topLevelApplication.project.shading.shadingFromHouses.shadingSouthWest;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromNeighbouringHouses.shadingNorthWest = FlexGlobals.topLevelApplication.project.shading.shadingFromHouses.shadingNorthWest;
			
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromTrees.shadingEast = FlexGlobals.topLevelApplication.project.shading.shadingFromTrees.shadingEast;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromTrees.shadingNorth = FlexGlobals.topLevelApplication.project.shading.shadingFromTrees.shadingNorth;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromTrees.shadingWest = FlexGlobals.topLevelApplication.project.shading.shadingFromTrees.shadingWest;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromTrees.shadingSouth = FlexGlobals.topLevelApplication.project.shading.shadingFromTrees.shadingSouth;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromTrees.shadingSouthEast = FlexGlobals.topLevelApplication.project.shading.shadingFromTrees.shadingSouthEast;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromTrees.shadingNorthEast = FlexGlobals.topLevelApplication.project.shading.shadingFromTrees.shadingNorthEast;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromTrees.shadingSouthWest = FlexGlobals.topLevelApplication.project.shading.shadingFromTrees.shadingSouthWest;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromTrees.shadingNorthWest = FlexGlobals.topLevelApplication.project.shading.shadingFromTrees.shadingNorthWest;
			
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromBalconies.shadingEast = FlexGlobals.topLevelApplication.project.shading.shadingFromBalconies.shadingEast;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromBalconies.shadingNorth = FlexGlobals.topLevelApplication.project.shading.shadingFromBalconies.shadingNorth;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromBalconies.shadingWest = FlexGlobals.topLevelApplication.project.shading.shadingFromBalconies.shadingWest;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromBalconies.shadingSouth = FlexGlobals.topLevelApplication.project.shading.shadingFromBalconies.shadingSouth;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromBalconies.shadingSouthEast = FlexGlobals.topLevelApplication.project.shading.shadingFromBalconies.shadingSouthEast;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromBalconies.shadingNorthEast = FlexGlobals.topLevelApplication.project.shading.shadingFromBalconies.shadingNorthEast;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromBalconies.shadingSouthWest = FlexGlobals.topLevelApplication.project.shading.shadingFromBalconies.shadingSouthWest;
			(FlexGlobals.topLevelApplication.screenCollection[7] as ShadingView).shadingFromBalconies.shadingNorthWest = FlexGlobals.topLevelApplication.project.shading.shadingFromBalconies.shadingNorthWest;
		}
	}
}